﻿Imports System
Imports System.CodeDom
Imports System.ComponentModel
Imports System.Workflow.Activities.Rules

Namespace System.Workflow.Activities.Rules.Design
    Friend Class RuleConditionReferenceTypeConverter
        Inherits TypeConverter
        ' Methods
        Public Overrides Function GetProperties(ByVal context As ITypeDescriptorContext, ByVal value As Object, ByVal attributes As Attribute()) As PropertyDescriptorCollection
            Dim descriptors As New PropertyDescriptorCollection(Nothing)
            descriptors.Add(New RuleConditionReferenceNamePropertyDescriptor(context, TypeDescriptor.CreateProperty(GetType(RuleConditionReference), "ConditionName", GetType(String), New Attribute() { New DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content), DesignOnlyAttribute.Yes })))
            descriptors.Add(New RuleConditionReferencePropertyDescriptor(context, TypeDescriptor.CreateProperty(GetType(RuleConditionReference), "Expression", GetType(CodeExpression), New Attribute() { New DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content), DesignOnlyAttribute.Yes })))
            Return descriptors.Sort(New String() { "ConditionName", "Expression" })
        End Function

        Public Overrides Function GetPropertiesSupported(ByVal context As ITypeDescriptorContext) As Boolean
            Return True
        End Function

    End Class
End Namespace

